const rand = require('./rand');

//获得概率的结果
function percent(p) {
  let res = rand(1, 100);
  //判断
  if (res <= p) {
    return true;
  } else {
    return false;
  }
}

//暴露
module.exports = percent;